﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OmegaEngine
{
    // Rework this with delegates to register to certain variables
    public class CVar<T>
    {
        public delegate T CVarHandler();

        public int Properties { get; set; }
        T val;
        CVarHandler Value;

        public CVar(CVarHandler Var, string Name, int Flags)
        {

        }

        /*public T Value
        {
            get { return val; }
            set
            {
                //if(!Properties.H
                return;
                // val = value;
            }
        }*/
    }

    public static class CVarRegistry
    {
        public static int NONE          = 0;   // Has no special properties
        public static int GETTABLE      = 1;   // Can be read
        public static int SETTABLE      = 2;   // Cam be overwritten
        public static int CHEATSENABLED = 4;   // Requires cheats to be enabled
        public static int SINGLEPLAYER  = 8;   // Usable only in singleplayer
        public static int MULTIPLAYER   = 16;   // Usable only in multiplayer

        // Dictionary to hold our cvars, allows insertion of new cvars if they don't exist
        // but refuses new cvars if they do. We map String-> String, and convert to other
        // data types if needed.
        static Dictionary<string, Object> CVars;

        // public static T GetValue<T>(Type owner, string paramName)
        // {
        //     CVar cvar;
        // }
    }
}
